<template>
  <div>
    <!-- <el-button
      class="diy-grid-setting"
      round
      plain
      size="medium"
      icon="el-icon-download"
      :loading="downloadLoading"
      @click.stop="download"
    ></el-button> -->
    <div class="diy-grid-setting" @click.stop="download">
		<i class="sc-icon-file-excel-2-fill"></i>
	</div>
  </div>
</template>
<script>
import { reactive, toRefs } from "@vue/reactivity";

export default {
  props: {
    multipleTable: {
      type: Object,
    },
  },
  setup(props) {
    const data = reactive({
      downloadLoading: false,
    });
    const exportExcel = (tableRef, filename, selection) => {
      data.downloadLoading = true;
      // 采用动态导入
      import("@/utils/Export2Excel").then((excel) => {
        excel.export_table_to_excel({ tableRef, filename, selection });
        data.downloadLoading = false;
      });
    };
    const download = () => {
      console.log(props.multipleTable)
      exportExcel(props.multipleTable, "盘点结果");
    };
    return { ...toRefs(data), download };
  },
};
</script>
<style scoped>
.diy-grid-setting {
  position: fixed;
  width: 40px;
  height: 40px;
  border-radius: 3px 0 0 3px;
  bottom: 180px;
  right: 0px;
  z-index: 100;
  background: #409eff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.diy-grid-setting i {
  font-size: 18px;
  color: #fff;
}
</style>